Optimal. Leaf size=111 \[ \frac {\left (2 b c d+a \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {\left (2 a c d-b \left (c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^2 f}+\frac {b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3610, 3612,
3611} \begin {gather*} \frac {b c-a d}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}+\frac {\left (2 a c d-b \left (c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^2}+\frac {x \left (a \left (c^2-d^2\right )+2 b c d\right )}{\left (c^2+d^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3610
Rule 3611
Rule 3612
Rubi steps
\begin {align*} \int \frac {a+b \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx &=\frac {b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac {\int \frac {a c+b d+(b c-a d) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{c^2+d^2}\\ &=\frac {\left (2 b c d+a \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac {\left (2 a c d-b \left (c^2-d^2\right )\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^2}\\ &=\frac {\left (2 b c d+a \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {\left (2 a c d-b \left (c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^2 f}+\frac {b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.25, size = 189, normalized size = 1.70 \begin {gather*} \frac {\frac {b ((-i c-d) \log (i-\tan (e+f x))+i (c+i d) \log (i+\tan (e+f x))+2 d \log (c+d \tan (e+f x)))}{c^2+d^2}+(b c-a d) \left (\frac {i \log (i-\tan (e+f x))}{(c+i d)^2}-\frac {i \log (i+\tan (e+f x))}{(c-i d)^2}+\frac {2 d \left (-2 c \log (c+d \tan (e+f x))+\frac {c^2+d^2}{c+d \tan (e+f x)}\right )}{\left (c^2+d^2\right )^2}\right )}{2 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 141, normalized size = 1.27
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-2 a c d +b \,c^{2}-b \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{2}-a \,d^{2}+2 b c d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}-\frac {a d -b c}{\left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (2 a c d -b \,c^{2}+b \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}}{f}\) | \(141\) |
default | \(\frac {\frac {\frac {\left (-2 a c d +b \,c^{2}-b \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{2}-a \,d^{2}+2 b c d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}-\frac {a d -b c}{\left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (2 a c d -b \,c^{2}+b \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}}{f}\) | \(141\) |
norman | \(\frac {\frac {c \left (a \,c^{2}-a \,d^{2}+2 b c d \right ) x}{c^{4}+2 c^{2} d^{2}+d^{4}}+\frac {d \left (a \,c^{2}-a \,d^{2}+2 b c d \right ) x \tan \left (f x +e \right )}{c^{4}+2 c^{2} d^{2}+d^{4}}+\frac {\left (a d -b c \right ) d \tan \left (f x +e \right )}{c f \left (c^{2}+d^{2}\right )}}{c +d \tan \left (f x +e \right )}+\frac {\left (2 a c d -b \,c^{2}+b \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}-\frac {\left (2 a c d -b \,c^{2}+b \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}\) | \(226\) |
risch | \(\frac {i x b}{2 i c d -c^{2}+d^{2}}-\frac {a x}{2 i c d -c^{2}+d^{2}}-\frac {4 i a c d x}{c^{4}+2 c^{2} d^{2}+d^{4}}+\frac {2 i b \,c^{2} x}{c^{4}+2 c^{2} d^{2}+d^{4}}-\frac {2 i b \,d^{2} x}{c^{4}+2 c^{2} d^{2}+d^{4}}-\frac {4 i a c d e}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}+\frac {2 i b \,c^{2} e}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}-\frac {2 i b \,d^{2} e}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}-\frac {2 i d^{2} a}{\left (-i c +d \right ) f \left (i c +d \right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )} d +i c \,{\mathrm e}^{2 i \left (f x +e \right )}-d +i c \right )}+\frac {2 i d b c}{\left (-i c +d \right ) f \left (i c +d \right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )} d +i c \,{\mathrm e}^{2 i \left (f x +e \right )}-d +i c \right )}+\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a c d}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b \,c^{2}}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b \,d^{2}}{f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}\) | \(482\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 181, normalized size = 1.63 \begin {gather*} \frac {\frac {2 \, {\left (a c^{2} + 2 \, b c d - a d^{2}\right )} {\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac {2 \, {\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {2 \, {\left (b c - a d\right )}}{c^{3} + c d^{2} + {\left (c^{2} d + d^{3}\right )} \tan \left (f x + e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.33, size = 228, normalized size = 2.05 \begin {gather*} \frac {2 \, b c d^{2} - 2 \, a d^{3} + 2 \, {\left (a c^{3} + 2 \, b c^{2} d - a c d^{2}\right )} f x - {\left (b c^{3} - 2 \, a c^{2} d - b c d^{2} + {\left (b c^{2} d - 2 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (b c^{2} d - a c d^{2} - {\left (a c^{2} d + 2 \, b c d^{2} - a d^{3}\right )} f x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (c^{4} d + 2 \, c^{2} d^{3} + d^{5}\right )} f \tan \left (f x + e\right ) + {\left (c^{5} + 2 \, c^{3} d^{2} + c d^{4}\right )} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 0.89, size = 2878, normalized size = 25.93 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 241 vs.
\(2 (114) = 228\).
time = 0.54, size = 241, normalized size = 2.17 \begin {gather*} \frac {\frac {2 \, {\left (a c^{2} + 2 \, b c d - a d^{2}\right )} {\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac {2 \, {\left (b c^{2} d - 2 \, a c d^{2} - b d^{3}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{4} d + 2 \, c^{2} d^{3} + d^{5}} + \frac {2 \, {\left (b c^{2} d \tan \left (f x + e\right ) - 2 \, a c d^{2} \tan \left (f x + e\right ) - b d^{3} \tan \left (f x + e\right ) + 2 \, b c^{3} - 3 \, a c^{2} d - a d^{3}\right )}}{{\left (c^{4} + 2 \, c^{2} d^{2} + d^{4}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.61, size = 153, normalized size = 1.38 \begin {gather*} \frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (-b\,c^2+2\,a\,c\,d+b\,d^2\right )}{f\,{\left (c^2+d^2\right )}^2}-\frac {a\,d-b\,c}{f\,\left (c^2+d^2\right )\,\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (b+a\,1{}\mathrm {i}\right )}{2\,f\,\left (-c^2+c\,d\,2{}\mathrm {i}+d^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (a+b\,1{}\mathrm {i}\right )}{2\,f\,\left (-c^2\,1{}\mathrm {i}+2\,c\,d+d^2\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________